<!DOCTYPE html>
<html>

	<head>
		<meta charset="UTF-8">
		<title>文件修改-lambkit</title>
		<meta name="renderer" content="webkit">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0, minimum-scale=1.0, maximum-scale=1.0, user-scalable=0">
		<link rel="shortcut icon" href="/favicon.ico" type="image/x-icon" />
		<link rel="stylesheet" href="#(ctx)/lambkit/assets/libs/layui/css/layui.css">
		<link rel="stylesheet" href="#(ctx)/lambkit/assets/css/style.css">
	</head>

	<body>
		<div class="lambkit-fluid">
			<div class="layui-row layui-col-space15">
				<div class="layui-col-md12">
					<div class="layui-card">
						<div class="layui-card-header">修改</div>
						<div class="layui-card-body">
							<form id="myform" class="layui-form" method="post" action="#(ctx)/lambkit/dev/file/update">
								<input type="hidden" name="type" id="type" value="edit" />
								<input type="hidden" name="model.path" id="path" value="#(path)" />
								<div class="layui-form-item layui-form-text">
									<label class="layui-form-label">文件内容</label>
									<div class="layui-input-block">
										<textarea name="model.info" rows="30" placeholder="请输入内容" class="layui-textarea">#(info)</textarea>
									</div>
								</div>
								<div class="layui-form-item">
									<div class="layui-input-block">
										<button class="layui-btn btn_save2" lay-submit lay-filter="formDemo">提交</button>
										<button type="button" class="layui-btn layui-btn-primary btn_back2">返回</button>
									</div>
								</div>
							</form>
						</div>
					</div>
				</div>
			</div>
		</div>

		<script src="#(ctx)/lambkit/assets/libs/layui/layui.js" charset="utf-8"></script>
		<script type="text/javascript" src="#(ctx)/lambkit/assets/jquery.min.js"></script>
		<script>
			$(function() {
				$(".btn_back2").click(function() {
					window.history.go(-1);
				});
				$(".btn_save2").click(function() {
					$.post("#(ctx)/lambkit/dev/file/update", $("#myform").serializeArray(), function(data) {
						if(data) {
							alert("保存成功！");
							window.history.go(-1);
						} else {
							alert("保存失败！");
						}
					});
				});
			});
		</script>

	</body>

</html>